import request from '@/utils/request'


// 获取题库列表
export const GetQuestionBanks = (obj:any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetQuestionBanks'
    })
}

// 获取试题列表
export const GetQuestions = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetQuestions'
    })
}


// 获取题目数量
export const GetQuestionsCount = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetQuestionsCount'
    })
}


// 发布 - 取消
export const PublishQuestionBanks = (obj: { ids: any, isPublish: number }) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/PublishQuestionBanks'
    })
}

// 获取标签
export const GetLabels = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetLabels'
    })
}

// 新增题库
export const AddQuestionBank = (obj: { name: string, labels: any, lv: number, parentid: string, explain: string }) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/AddQuestionBank'
    })
}

// 新增试题
export const AddQuestions = (obj:any) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/AddQuestions'
    })
}


// 删除题库
export const DeleteQuestionBanks = (obj: { ids: any }) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/DeleteQuestionBanks'
    })
}

// 题库详细
export const GetSingleQuestionBank = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetSingleQuestionBank'
    })
}

// 修改题库
export const UpdateQuestionBank = (obj: {explain: string,name: string,id:any,labels: any,lv:number}) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/UpdateQuestionBank'
    })
}

// 删除试题
export const DeleteQuestions = (obj: {ids:any}) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/DeleteQuestions'
    })
}

// 获取单个题目
export const GetSingleQuestion = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetSingleQuestion'
    })
}

// 试题禁用-恢复
export const BanQuestions = (obj: {ids:any,isBan:number}) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/BanQuestions'
    })
}

// 发布取消试题
export const PublishQuestions = (obj: {ids:any,isPublish:number}) => {
    return request({
        method: 'Post',
        data: obj,
        url: 'api/Exam/publishQuestions'
    })
}

// 获取题库列表
export const GetQuestionBank = (obj: { page: number, limit: number, key: string, isBan: number, isPublish: number,labels:any,banks:any,excludeQBID:any }) => {
    return request({
        method: 'get',
        params: obj,
        url: 'api/Exam/GetQuestionBanks'
    })
}


//移除题目
export const RemoveQuestionFromBank =(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'api/Exam/RemoveQuestionFromBank'
    })
}


//导入题库
export const MoveQuestionsToBank =(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'api/Exam/MoveQuestionsToBank'
    })
}


// 获取随机试题
export const RandomQuestions =(obj:any)=>{
    return request({
        method:'get',
        params:obj,
        url:'api/Exam/RandomQuestions'
    })
}

// 确认组卷
export const AddTestPaper =(obj:any)=>{
    return request({
        method:'Post',
        data:obj,
        url:'api/Exam/AddTestPaper'
    })
}






















